feat: add Actor task publication endpoints - #989
Conversation
|
See more at https://github.com/apify/apify-client-js/actions/runs/30812758842#summary-91683107965 |
Waiting for apify/apify-docs#2840 |
| categorization?: string | null; | ||
| inputSchemaFields?: string[] | null; | ||
| datasetName?: string | null; | ||
| datasetView?: string | null; |
There was a problem hiding this comment.
Important: You're missing highlightedFields?: string[] | null as far as I remember
There was a problem hiding this comment.
It's stale no? I don't think it's used anywhere and if we decide to use it, the I would add it to public facing API, wdyt?
There was a problem hiding this comment.
Hmm, good catch I guess we kept duplicated field to inputSchemaFields. No idea how that happened, we should remove it then.
| * The task's Actor must be public and the task must have its public display configuration | ||
| * (`publicConfig`) set up via {@apilink TaskClient.update}. |
There was a problem hiding this comment.
Suggestion: I would also mention that you need write access to the Actor.
| export type TaskUpdateData = Partial< | ||
| Pick<Task, 'name' | 'title' | 'description' | 'options' | 'input' | 'actorStandby'> | ||
| >; | ||
| > & { publicConfig?: Omit<TaskPublicConfig, 'publishedAt'> | null }; |
There was a problem hiding this comment.
Question: | null suggests that you can nullify this publicConfig object which you technically can't (we just ignore it while updating the rest) so I would probably drop it here and also in apify-core, WDYT?
katzino
left a comment
There was a problem hiding this comment.
LGTM, two comments, mostly informative ones.
| categorization?: string | null; | ||
| inputSchemaFields?: string[] | null; | ||
| datasetName?: string | null; | ||
| datasetView?: string | null; |
There was a problem hiding this comment.
Hmm, good catch I guess we kept duplicated field to inputSchemaFields. No idea how that happened, we should remove it then.
| @@ -317,7 +381,7 @@ export interface TaskOptions { | |||
| */ | |||
| export type TaskUpdateData = Partial< | |||
There was a problem hiding this comment.
Note: I commented on it at https://github.com/apify/apify-core/pull/29623#discussion_r3682214152 - TaskCreateData extends this type that means create method takes publicConfig but the endpoint in apify-core currently won't set it. Should be addressed there, not a blocker in this PR.
| validateRequest({ query: {}, params: { taskId } }); | ||
| }); | ||
|
|
||
| test('unpublish() works', async () => { |
There was a problem hiding this comment.
is this dependent on the previous test? Ideally, tests should work in isolation, if they are dependent, maybe just merge them to a single test case
Part of https://github.com/apify/apify-core/issues/29471
Add ability to publish and un-publish tasks via new API
Blocked by https://github.com/apify/apify-core/pull/29623